﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CRM.CapaDatos;

namespace Crear_Campana
{
    public partial class Campanas : System.Web.UI.Page
    {
        string cadena = ConnectionStringManager.GetOnPremiseConnString();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CargarCampanas();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("Campana.aspx");
        }

        protected void btnDelete_Click(object sender, EventArgs e)
        {
            EliminarCampana();
        }

        private void EliminarCampana()
        {
            //TODO
        }

        private void CargarCampanas()
        {
            DAOCampana obj = new DAOCampana(cadena);
            grvCampanas.DataSource = obj.Listar();
            grvCampanas.DataBind(); 
        }

    }
}